package com.example.starter.dto;

import java.io.Serializable;

import lombok.Data;

/**
 * Created by liuw on 2017/11/14.
 */
@Data
public class ResultBean<T> implements Serializable {
    public static final int NO_LOGIN = -1;
    public static final int SUCCESS = 0;
    public static final int FAIL = 1;
    public static final int NO_PERMISSION = 2;
    public static final int BEAN_VALIDATION_ERROR = 3;

    private int code = SUCCESS;

    private String msg = "success";

    private T data;

    public ResultBean() {
        super();
    }

    public ResultBean(T data) {
        super();
        this.data = data;
    }

    public ResultBean(Throwable e) {
        super();
        this.code = FAIL;
        this.msg = e.toString();
    }
}
